Gaussian mixture model (GMM) is easily affected by noise, and Markov random field (MRF) model can well describe the spatial characteristics. The combination of the two is suitable for image segmentation with noise, but MRF model is prone to over segmentation. To solve this problem, an improved image segmentation algorithm based on adaptive weight coefficient was proposed, which can segment cerebrospinal fluid, gray matter and white matter from magnetic resonance imaging (MRI). Firstly, the K?means algorithm was used to obtain the initial segmentation results, and the Expectation?Maximization (EM) algorithm was used to estimate the parameters of GMM, and then the joint probability energy function of the pixel gray level of the image was obtained. Then, the adaptive weight coefficient was obtained by using the gray value, posterior probability and Euclidean distance of the center pixel and the neighboring pixels of the MRF neighborhood system, and the prior probability energy function was obtained by MRF. Finally, the final image segmentation results were obtained by Bayesian criterion. Experimental results show that the algorithm has strong adaptability, can better overcome the impact of noise on image segmentation. Compared with similar algorithms, the proposed algorithm has higher segmentation accuracy for brain MR images with noise, and obtains better segmentation results.